<template>
  <div class="box">
    <el-row>
      <el-col :span="24">
        <div class="header">
          <el-form ref="form" :model="form" label-width="100px" class="flex">
            <div style="width: 386px">
              <el-form-item label="投诉">
                <el-date-picker
                  v-model="value1"
                  style="width: 100%"
                  type="datetimerange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期"
                >
                </el-date-picker>
              </el-form-item>
            </div>
            <el-form-item label="数据范围" style="margin-left: 10px">
              <el-select
                v-model="form.region"
                placeholder="请选择网点"
                style="width: 286px"
              >
                <el-option label="区域一" value="shanghai"></el-option>
                <el-option label="区域二" value="beijing"></el-option>
              </el-select>
            </el-form-item>

            <el-form-item>
              <el-button type="primary" @click="onSubmit">查询</el-button>
              <el-button>重置</el-button>
            </el-form-item>
          </el-form>
        </div>
      </el-col>
    </el-row>
    <el-row type="flex" justify="space-between">
      <el-col :span="6">
        <div class="borde-left">末端通知</div>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12"
        ><div class="ech">
          <div style="display: flex">
            <div>
              <div class="ech-left">
                <div>
                  <span style="font-size: 18px">电联率</span>
                  <span style="font-size: 30px; font-weight: bold">11</span>
                  <span style="font-size: 18px; color: #999999"
                    >电联量:
                    <span style="font-weight: bold; color: black">677</span>
                  </span>
                  <span style="font-size: 18px; color: #999999"
                    >签收量:<span style="font-weight: bold; color: black"
                      >34214</span
                    ></span
                  >
                </div>
                <div
                  class="echart"
                  ref="mychart"
                  id="mychart"
                  :style="{ float: 'left', width: '600px', height: '240px' }"
                ></div>
              </div>
            </div>
            <div>
              <div class="ech-left">
                <div>
                  <span style="font-size: 18px">电联率</span>
                  <span style="font-size: 30px; font-weight: bold">11</span>
                  <span style="font-size: 18px; color: #999999"
                    >电联量:
                    <span style="font-weight: bold; color: black">677</span>
                  </span>
                  <span style="font-size: 18px; color: #999999"
                    >签收量:<span style="font-weight: bold; color: black"
                      >34214</span
                    ></span
                  >
                </div>
                <div
                  class="echart"
                  ref="mychart2"
                  id="mychart2"
                  :style="{ float: 'left', width: '600px', height: '240px' }"
                ></div>
              </div>
            </div>
          </div>
          <el-row type="flex" justify="space-between">
            <el-col :span="6">
              <div class="borde-left" style="margin-left: -1px">
                签收类型通知
              </div>
            </el-col>
          </el-row>
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="本人签收" name="first">
              <el-row type="flex" justify="space-between">
                <el-col :span="24">
                  <el-table :data="tableData" border style="width: 100%">
                    <el-table-column prop="zip" label="订单客户" width="120">
                    </el-table-column>
                    <el-table-column
                      prop="zip"
                      label="面单发放对象/打单员"
                      width="120"
                    >
                    </el-table-column>
                    <el-table-column prop="zip" label="出港中心" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="集包网点" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="包号" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="签约网点" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="备注" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="始发省份" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="始发城市" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="寄件人" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="寄件地址" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="报价ID" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="未收面单费" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="签收时间" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="有效状态" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="锁定状态" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="锁定/解锁人" width="120">
                    </el-table-column>
                    <el-table-column
                      prop="zip"
                      label="锁定/解锁时间"
                      width="120"
                    >
                    </el-table-column>
                    <el-table-column prop="zip" label="修改人" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="修改时间" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="送货上门" width="120">
                    </el-table-column>
                  </el-table>
                </el-col>
              </el-row>
              <div class="block" style="display: flex; justify-content: end">
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[100, 200, 300, 400]"
                  :page-size="100"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="400"
                >
                </el-pagination></div
            ></el-tab-pane>
            <el-tab-pane label="社会代收" name="second">社会代收</el-tab-pane>
            <el-tab-pane label="品牌代收" name="third">品牌代收</el-tab-pane>
          </el-tabs>
        </div></el-col
      >
      <el-col :span="12"
        ><div class="ech">
          <div style="display: flex">
            <div>
              <div class="ech-left">
                <div>
                  <span style="font-size: 18px">电联率</span>
                  <span style="font-size: 30px; font-weight: bold">11</span>
                  <span style="font-size: 18px; color: #999999"
                    >电联量:
                    <span style="font-weight: bold; color: black">677</span>
                  </span>
                  <span style="font-size: 18px; color: #999999"
                    >签收量:<span style="font-weight: bold; color: black"
                      >34214</span
                    ></span
                  >
                </div>
                <div
                  class="echart"
                  ref="mychart3"
                  id="mychart3"
                  :style="{ float: 'left', width: '600px', height: '240px' }"
                ></div>
              </div>
            </div>
            <div>
              <div class="ech-left">
                <div>
                  <span style="font-size: 18px">电联率</span>
                  <span style="font-size: 30px; font-weight: bold">11</span>
                  <span style="font-size: 18px; color: #999999"
                    >电联量:
                    <span style="font-weight: bold; color: black">677</span>
                  </span>
                  <span style="font-size: 18px; color: #999999"
                    >签收量:<span style="font-weight: bold; color: black"
                      >34214</span
                    ></span
                  >
                </div>
                <div
                  class="echart"
                  ref="mychart4"
                  id="mychart4"
                  :style="{ float: 'left', width: '600px', height: '240px' }"
                ></div>
              </div>
            </div>
          </div>
          <el-row type="flex" justify="space-between">
            <el-col :span="6">
              <div class="borde-left" style="margin-left: -1px">平台通知</div>
            </el-col>
          </el-row>
          <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="菜鸟" name="first">
              <el-row type="flex" justify="space-between">
                <el-col :span="24">
                  <el-table :data="tableData" border style="width: 100%">
                    <el-table-column prop="zip" label="订单客户" width="120">
                    </el-table-column>
                    <el-table-column
                      prop="zip"
                      label="面单发放对象/打单员"
                      width="120"
                    >
                    </el-table-column>
                    <el-table-column prop="zip" label="出港中心" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="集包网点" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="包号" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="签约网点" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="备注" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="始发省份" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="始发城市" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="寄件人" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="寄件地址" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="报价ID" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="未收面单费" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="签收时间" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="有效状态" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="锁定状态" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="锁定/解锁人" width="120">
                    </el-table-column>
                    <el-table-column
                      prop="zip"
                      label="锁定/解锁时间"
                      width="120"
                    >
                    </el-table-column>
                    <el-table-column prop="zip" label="修改人" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="修改时间" width="120">
                    </el-table-column>
                    <el-table-column prop="zip" label="送货上门" width="120">
                    </el-table-column>
                  </el-table>
                </el-col>
              </el-row>
              <div class="block" style="display: flex; justify-content: end">
                <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage4"
                  :page-sizes="[100, 200, 300, 400]"
                  :page-size="100"
                  layout="total, sizes, prev, pager, next, jumper"
                  :total="400"
                >
                </el-pagination></div
            ></el-tab-pane>
            <el-tab-pane label="抖音" name="抖音">社会代收</el-tab-pane>
            <el-tab-pane label="拼多多" name="third">拼多多</el-tab-pane>
            <el-tab-pane label="申通" name="fourth">申通</el-tab-pane>
            <el-tab-pane label="快手" name="fifth">快手</el-tab-pane>
            <el-tab-pane label="其他" name="sixth">其他</el-tab-pane>
          </el-tabs>
        </div></el-col
      >
    </el-row>
    <el-row type="flex" justify="space-between">
      <el-col :span="6">
        <div class="borde-left" style="margin-left: -1px">通知明细</div>
      </el-col>
    </el-row>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="网点" name="first">
        <el-row type="flex" justify="space-between">
          <el-col :span="24">
            <el-table :data="tableData" border style="width: 100%">
              <el-table-column prop="zip" label="订单客户" width="120">
              </el-table-column>
              <el-table-column
                prop="zip"
                label="面单发放对象/打单员"
                width="120"
              >
              </el-table-column>
              <el-table-column prop="zip" label="出港中心" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="集包网点" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="包号" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="签约网点" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="备注" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="始发省份" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="始发城市" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="寄件人" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="寄件地址" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="报价ID" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="未收面单费" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="签收时间" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="有效状态" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="锁定状态" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="锁定/解锁人" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="锁定/解锁时间" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="修改人" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="修改时间" width="120">
              </el-table-column>
              <el-table-column prop="zip" label="送货上门" width="120">
              </el-table-column>
            </el-table>
          </el-col>
        </el-row>
        <div class="block" style="display: flex; justify-content: end">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
          >
          </el-pagination></div
      ></el-tab-pane>
      <el-tab-pane label="承包区" name="抖音">承包区</el-tab-pane>
      <el-tab-pane label="小件员" name="third">小件员</el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import * as echarts from "echarts";
export default {
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        currentPage4: 4,
        desc: "",
      },
      textList: [
        {
          h1: "揽收及时率[1104-1104]",
          h2: "95.65%",
          h3: "95",
          h4: "4.49",
        },
      ],
      tableData: [],
      activeName: "first",
    };
  },
  mounted() {
    this.initEcharts();
  },
  methods: {
    initEcharts() {
      const option = {
        xAxis: {
          show: false, // 设置 x 轴不显示
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          show: false, // 设置 y 轴不显示
          type: "value",
        },
        lineStyle: {
          // 阴影部分
          shadowOffsetX: 0, // 折线的X偏移
          shadowOffsetY: 9, // 折线的Y偏移
          shadowBlur: 8, // 折线模糊
          shadowColor: "rgba(145, 132, 132, 1)", //折线颜色
        },

        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: "line",
            smooth: true,
            lineStyle: {
              color: "blue",
            },
            symbol: "none",
            areaStyle: {
              //区域填充渐变颜色
              color: {
                type: "linear",
                x: 0,
                y: 0,
                x2: 0,
                y2: 1,
                colorStops: [
                  {
                    offset: 0,
                    color: "rgba(32, 135, 208, 1)", // 0% 处的颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(255, 255, 255, 0)", // 100% 处的颜色
                  },
                ],
                global: false, // 缺省为 false
              },
            },
          },
        ],
      };
      const myChart = echarts.init(this.$refs.mychart); // 图标初始化
      const myChart2 = echarts.init(this.$refs.mychart2); // 图标初始化
      const myChart3 = echarts.init(this.$refs.mychart3); // 图标初始化
      const myChart4 = echarts.init(this.$refs.mychart4); // 图标初始化
      myChart.setOption(option); // 渲染页面
      myChart2.setOption(option); // 渲染页面
      myChart3.setOption(option); // 渲染页面
      myChart4.setOption(option); // 渲染页面

      //随着屏幕大小调节图表
      window.addEventListener("resize", () => {
        myChart.resize();
        myChart2.resize();
        myChart3.resize();
        myChart4.resize();
      });
    },
    handleClick(tab, event) {
      console.log(tab, event);
    },
  },
};
</script>
<style lang="scss" scoped>
.box {
  padding: 0px 20px;
}
.borde-left {
  border-left: 3px solid #2087d0;
  padding-left: 10px;
}

.flex {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}
.ech {
  display: flex;
  flex-flow: column;
}
.ech-top {
  height: 140px;
  display: flex;
  flex-flow: column;
  justify-content: space-evenly;
  align-items: flex-start;
  padding-left: 20px;
}
.ech-left {
  height: 188px;
  width: 450px;
  display: flex;
  justify-content: space-evenly;
  align-items: flex-start;
  padding-left: 20px;
}
.ech-left > div {
  height: 188px;
  width: 353px;
  display: flex;
  flex-flow: column;
  justify-content: space-evenly;
  align-items: flex-start;
}

.flex-bettom {
  display: flex;
  justify-content: space-between;
}

.header {
  padding: 20px 0;
  border-bottom: 1px solid #ccc;
}

.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
</style>
